#include <iostream>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

struct state {
	ll a, logb;

	state(ll _a, ll _logb) : a(_a), logb(_logb) {}
	void normalize() {
		while (a && !(a & 1)) {
			a >>= 1;
			logb--;
		}
	}
};

state operator+(state s1, state s2) {
	if (s1.logb < s2.logb) {
		s1.a *= 1LL << (s2.logb - s1.logb);
		s1.logb = s2.logb;
	}
	else if (s2.logb < s1.logb) {
		s2.a *= 1LL << (s1.logb - s2.logb);
		s2.logb = s1.logb;
	}

	state s(s1.a + s2.a, s1.logb);
	s.normalize();
	return s;
}

state operator-(state s1, state s2) {
	if (s1.logb < s2.logb) {
		s1.a *= 1LL << (s2.logb - s1.logb);
		s1.logb = s2.logb;
	}
	else if (s2.logb < s1.logb) {
		s2.a *= 1LL << (s1.logb - s2.logb);
		s2.logb = s1.logb;
	}

	state s(s1.a - s2.a, s1.logb);
	s.normalize();
	return s;
}

int main(){
	string s;
	while (cin >> s && s != "#") {
		vector<bool> dirs;
		int i = 0;
		while (i < s.size()) {
			if (s[i] == 'n') {
				dirs.push_back(0);
				i += 5;
			}
			else {
				dirs.push_back(1);
				i += 4;
			}
		}

		state cs = dirs.back() ? state(90, 0) : state(0, 0);
		dirs.pop_back();
		for (int i = 1; i <= dirs.size(); i++) {
			bool cur = dirs[dirs.size() - i];
			state b(90, i);
			cs = cur ? (cs + b) : (cs - b);
		}

		cout << cs.a;
		if (cs.logb)
			cout << "/" << (1 << cs.logb);
		cout << endl;
	}

	return 0;
}